
import javax.swing.JOptionPane;
import org.jdesktop.swingx.JXImagePanel;

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * photoshow.java
 *
 * Created on 31 Ιαν 2012, 7:32:45 μμ
 */
/**
 *
 * @author karolos
 */
public class photoshow extends javax.swing.JFrame {

    static int count = 0;//metabliti elegxou gia na min anoigei i idia fotografia polles fores

    /** Creates new form photoshow */
    public photoshow() {
        initComponents();
        count++;//kata ti dimiourgia ka8e stigmiotypoy ayxisi kata 1
        
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        imagepanel = new org.jdesktop.swingx.JXImagePanel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("Photo");
        setAlwaysOnTop(true);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                onclose(evt);
            }
        });

        javax.swing.GroupLayout imagepanelLayout = new javax.swing.GroupLayout(imagepanel);
        imagepanel.setLayout(imagepanelLayout);
        imagepanelLayout.setHorizontalGroup(
            imagepanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        imagepanelLayout.setVerticalGroup(
            imagepanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 300, Short.MAX_VALUE)
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(imagepanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(imagepanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );

        getAccessibleContext().setAccessibleParent(imagepanel);

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void onclose(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_onclose
        count = 0;
    }//GEN-LAST:event_onclose

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private org.jdesktop.swingx.JXImagePanel imagepanel;
    // End of variables declaration//GEN-END:variables

    public JXImagePanel getImagePanel() {
        return imagepanel;
    }

    public int getCount() {// elegxos an to antikeimeno trexei hdh.
        return count;
    }

    public void setCount(int count){
    this.count=count;
    }
}
